#include <string>
#include <vector>
#include<cmath>

using namespace std;

class Solution 
{

    private:

        vector<int> P;
        int the_size_of_P = 0;

        int HandleVector(vector<int>& A, int k)
        {
            int SHUT_UP = -1;
            int sum = 0;
            float max_single = 0;
            int max_all = 0;

            bool flag = true;
            int point;
            int point_size = 0;

            for(auto it : A)
            {
                if(it > max_single) max_single = it;

                P.push_back(sum + it);

                if(sum > P[the_size_of_P]) 
                {
                    P[the_size_of_P] = SHUT_UP;
                    if(flag == true)
                    {
                        point = the_size_of_P;
                        flag = false;
                        if(point>0) point_size = P[point - 1];
                    }
                }
                else
                {
                    if((flag == false) and (P[the_size_of_P] > point_size))
                    {
                        P[point] = SHUT_UP - the_size_of_P;
                        point_size = 0;
                        flag = true;
                    }
                    
                }
                
                if(P[the_size_of_P] > max_all) max_all = P[the_size_of_P];
                
                sum += it;
                ++the_size_of_P;
            }

            if(flag == false)
            {
                P[point] = SHUT_UP - the_size_of_P;
                point_size = 0;
                flag = true;
            }

            if(k > max_all)
                return -1;
            else if (ceil(k / max_single) > the_size_of_P)
                return -1;
            else
                return ceil(k / max_single);
            
        }


    public:

        int shortestSubarray(vector<int>& A, int K) 
        {
            int i = 0;
            int smallest_length;

            smallest_length = HandleVector(A, K);
            if(smallest_length == -1 ) return -1;
            if(smallest_length == 1 ) return 1;
            for(auto it : P)
            {

                while ((i + smallest_length) < the_size_of_P)
                {
                    // if(P[])
                }
                
                ++i;
            }

        }

};


int main()
{
    vector<int> A{1,2,3,-1,-1,3,4,5,6,-4,-1,3,3,3,4};
    int k = 4;
    Solution B;
    B.shortestSubarray(A,k);
    return 0;
}